package com.xzzz.irda.auth.core.filter;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import java.io.IOException;

/**
 * 授权相关过滤器接口, 继承Order实现过滤器排序
 *
 * 所有过滤器依赖于 spring 管理, 默认均为单例模式
 * 内部创建全局变量需要注意线程安全
 *
 * @author wangyf
 * 
 */
public interface AuthFilter extends Ordered {

    /**
     * 执行过滤
     * @param request request
     * @param response response
     * @param authFilterChain 过滤器链
     * @throws IOException io
     * @throws ServletException servlet
     */
    void doFilter(ServletRequest request, ServletResponse response,AuthFilterChain authFilterChain) throws IOException, ServletException;
}
